package sit.wetsion.galio.common.util;

/**
 * @author weixin
 * @version 1.0
 * @CLassName ResponseResults
 * @date 2019/5/27 11:54 AM
 */
public class ResponseResults {

    private Boolean success = true;
    private int code = 200;
    private String message;
    private Object results;

    public ResponseResults() {
    }

    public static ResponseResults ok(Object results) {
        ResponseResults responseResults = (new ResponseResults()).setSuccess(true).setResults(results);
        return responseResults;
    }

    public static ResponseResults error(int code, String message) {
        ResponseResults responseResults = (new ResponseResults()).setSuccess(false).setCode(code).setMessage(message);
        return responseResults;
    }

    public ResponseResults setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public ResponseResults setCode(int code) {
        this.code = code;
        return this;
    }

    public ResponseResults setMessage(String message) {
        this.message = message;
        return this;
    }

    public ResponseResults setResults(Object results) {
        this.results = results;
        return this;
    }

    public Boolean getSuccess() {
        return this.success;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public Object getResults() {
        return this.results;
    }
}
